# @Time    :2025/4/11 9:13

# 时间复杂度
import time




def sum(nums):
    start = time.time()
    res = 0
    i = -1
    while (i := i + 1) < len(nums):
        res += nums[i]
        end = time.time()
    print(f"总耗时:{end - start}")
    return res




# print(sum([1, 2, 45, 4]))
print(sum([x for x in range(10000)]))

